package cn.com.gridinfo.sooc.core.course.common;

import java.util.Arrays;
import java.util.List;

/**
 * 播放素材类型
 * Created by jieli on 16/1/19.
 */
public  enum  ExtType {

    JPG("jpg","photo","图片"),
    GIF("gif","photo","图片"),
    PNG("png","photo","图片"),
    BMP("bmp","photo","图片"),
    JPEG("jpeg","photo","图片"),
    DOC("doc","doc","文档"),
    DOCX("docx","doc","文档"),
    XLS("xls","doc","表单"),
    XLSX("xlsx","doc","表单"),
    PPT("ppt","doc","电子文档"),
    PPTX("pptx","doc","电子文档"),
    AVI("avi","video","视频"),
    RM("rm","video","视频"),
    RMVB("rmvb","video","视频"),
    WMV("wmv","video","视频"),
    FLV("flv","video","视频"),
    MPG("mpg","video","视频"),
    MPEG("mpeg","video","视频"),
    MP4("mp4","video","视频"),
    m3u8("m3u8","video","视频"),
    MOV("mov","video","视频"),
    GP3("3gp","video","视频3gp"),
    MKV("mkv","video","视频"),
    PDF("pdf","doc","电子文档"),
    SWF("swf","flash","flash文档"),
    XT("-1","-1","习题");


    //TODO 加密视频




    private String typeName;
    private String typeClass = "doc";
    private String remark;

    ExtType(String typeName,String typeClass,String remark){
        this.typeName = typeName;
        this.typeClass = typeClass;
        this.remark = remark;
    }


    /**
     * 获取所有素材类型
     * @return
     */
    public static List<ExtType> getAll() {
        return Arrays.asList(ExtType.values());
    }


    /**
     * 获取素材分类类型
     * @param typeName 素材类型名称
     * @return
     */
    public static String getExtTypeClass(String  typeName) {
        typeName = (typeName.trim()).toLowerCase();
        for (ExtType extType : values()) {
            if (typeName.equals(extType.getTypeName())) {
                return extType.getTypeClass();
            }
        }
        return "";
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getTypeClass() {
        return typeClass;
    }

    public void setTypeClass(String typeClass) {
        this.typeClass = typeClass;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
}
